package com.cmwa.scbp.utils;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.multipart.MultipartResolver;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;

/**
 * @author : chenxh
 * @date : Created in 2019/3/11 18:37
 * @description: 注册CommonsMultipartResolver 解决request转成 MultipartHttpServletRequest
 * @modified By:
 * @version:
 */
@Configuration
public class MultipartAutoConfiguration {

    @Bean(name = "multipartResolver")
    public MultipartResolver multipartResolver(){
        CommonsMultipartResolver resolver = new CommonsMultipartResolver();
        resolver.setDefaultEncoding("UTF-8");
        return resolver;
    }
}
